<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- header -->
    <%@ include file="/WEB-INF/views/include/header.jsp" %>
    <link rel="stylesheet" href="<s:url value="/assets/css/main.css"></s:url>"/>
</head>
<style>
    #laydate_today {
        display: none !important;
    }
    .title{
        width: 100%;
        height: 120px;
        margin: 20px auto;
    }
    .title_div1,.title_div2,.title_div3{
        width: 100%;
        height: 40px;
        text-align: left;
        line-height: 40px;
    }
    .title_div4{
        width: 100%;
        text-align: left;
        margin-top: 10px;
    }
</style>
<body class="no-skin">
<%--上传成功模态框--%>
<div class="shade" style="display: none;"></div>
<div class="warning" style="display: none;">
    <p class="title"><em></em><span class="close">X</span></p>
    <p class="cont"></p>
    <div class="la-square-jelly-box la-3x">
        <div></div>
        <div></div>
    </div>
</div>


<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <!-- /section:settings.box -->
                <h3 class="text-center">《${projectDetail.projectName}》填报详情</h3>

                <div class="title container">
                    <div class="title_div1 row">
                        <div class="text1 col-xs-5	col-sm-3	col-md-2	col-lg-1">责任领导：</div>
                        <div class="text2 col-xs-7	col-sm-9	col-md-10	col-lg-11">${projectDetail.leaderName}</div>
                    </div>
                    <div class="title_div2 row">
                        <div class="text1 col-xs-5	col-sm-3	col-md-2	col-lg-1">责任单位：</div>
                        <div class="text2 col-xs-7	col-sm-9	col-md-10	col-lg-11">${zeren}</div>
                    </div>
                    <div class="title_div3 row">
                        <div class="text1 col-xs-5	col-sm-3	col-md-2	col-lg-1">配合单位：</div>
                        <div class="text2 col-xs-7	col-sm-9	col-md-10	col-lg-11">${peihe}</div>
                    </div>
                    <div class="title_div3 row">
                        <div class="text1 col-xs-5	col-sm-3	col-md-2	col-lg-1">备注：</div>
                        <div class="text2 col-xs-7	col-sm-9	col-md-10	col-lg-11">${projectDetail.remarks}</div>
                    </div>



                </div>

                <div id="projectId" style="display: none" >
                  ${projectId}
                </div>



                <div class="left-align">
                    <button class="btn btn-sm btn-success" id="kaigong-pass">审核通过</button>
                    <button class="btn btn-sm btn-danger" id="kaigong-fail">审核不通过</button>
<%--                    <button class="btn btn-sm btn-success" id="chaiqian-pass">审核拆迁-通过</button>--%>
<%--                    <button class="btn btn-sm btn-danger" id="chaiqian-fail">审核<strong>拆迁</strong>-不通过</button>--%>

                <%--<shiro:hasPermission name="modules:sys:table:query">
                    </shiro:hasPermission>
                    <shiro:hasPermission name="modules:sys:table:edit">
                    </shiro:hasPermission>
                  --%>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <!-- jqGrid表格 -->
                        <table id="gridTable"></table>
                        <!-- jqGrid工具类 -->
                        <div id="gridPager"></div>
                        <!-- 查询对话框 -->
                        <div style="display: none;">
                            <div class="row" id="queryDialog"></div>
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->

<%--                <h4 class="redTips">温馨提示：双击表格行或者点击"查看详情" 查看任务列表</h4>--%>
            </div>
        </div><!-- /.main-content -->

        <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
            <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
        </a>

        <%@ include file="/WEB-INF/views/include/dialog.jsp" %>
    </div><!-- /.main-container -->
</div>




<!-- footer -->
<%--多选上传--%>
<script src="<s:url value="/assets/js/dist/easyUploader.jq.js"></s:url>"></script>
<%@ include file="/WEB-INF/views/include/footer.jsp" %>
<script src="<s:url value="/assets/js/own.js"></s:url>"></script>

<script type="text/javascript">
    // 基本路径
    var baseUrl = "<s:url value="/sys/gongjian/projectTasks"></s:url>"

    // jqgrid的表格高度
    var height = 320;
    // jqgrid表格行头的中文
    var colNames = ['','feedId', '任务名称','审核状态','填报截止期限',"填报时间",'反馈账号','形象进度', /*'预计月底能否达成本月节点',*/ "备注（未达标备注）", "预估8月至本月底合计完成投资(亿)",'操作'];//我派发的任务\

    //我的任务表
    var colModel = [
        {name: 'sysId', width: 60, hidden: true},
        {name: 'feedbackId', width: 160, hidden: true, key: true},
        {name: 'taskName', index: 'taskName', width: 350, editable: true},
        {name: 'audit', index: 'audit', width: 140, editable: true,formatter:auditFormatter},
        {name: 'taskEndDate', index: 'taskEndDate', width: 140, editable: true},

        {name: 'createDate', index: 'createDate', width: 160, editable: true},
        {name: 'createName', index: 'createName', width: 100, editable: true},
        {name: 'xingxiang', index: 'xingxiang', width: 250, editable: true},
        {name: 'reachoals', index: 'reachoals', width: 200, editable: true,formatter: reahchFormatter},
        {name: 'remarks', index: 'remarks', width: 150, editable:                       true},
        // {name: 'addCurrentValue', index: 'addCurrentValue', width: 230, editable:           true},
        {name: 'sy', width: 60, align: "center", hidden: true,formatter: feedbackBtnFormatter},


    ];








    function reahchFormatter(value) {

        switch (value) {
            case 0:
                return "未填写"
            case 1:
                return "是"
            case 2:
                return "否"

        }
    }
    function  auditFormatter(value){
        switch (value) {
            case 0:
                return "未审核";
            case 1:
                return "审核通过";
            case 2:
                return "审核不通过";

        }
    }

    function feedbackBtnFormatter(value, grid, rowes, state) {
        grid.colModel.title = false
        return "<div style='color: #049CE6;display: flex;justify-content: center'>" +
            // "<div style='width: 80px;cursor: pointer' title='查看'id='showDetailView'>查看详情</div>" +
            // "<div class='establish' style='width: 40px;border-left:1px solid #049CE6;cursor: pointer; display: " + (rows.status == 9 ? "block" : "none") + "' title='立项'>立项</div>" +
            "<div style='width: 80px;cursor: pointer' title='反馈'class='lookdetail'> <a onclick=showEditView('"+rowes.sysId+"')>反馈任务</a></div>" +
            // "<div class='summary' style='width: 100px;border-left:1px solid #049CE6;cursor: pointer;' title='反馈汇总'>反馈汇总 </div>" +
            // "<div class='handle' style='width: 100px;border-left:1px solid #049CE6;cursor: pointer;' title='督查流程记录'>督查流程记录 </div>" +
            // "<div class='handle' style='width: 100px;border-left:1px solid #049CE6;cursor: pointer;' title='督查流程记录'>督查流程记录 </div>" +
            // "<div style='border-left:1px solid #049CE6;width: 40px;cursor: pointer'title='修改' class='modify' >单位反馈记录</div>" +
            // "<div class='deteleTask' style='width: 40px;border-left:1px solid #049CE6;cursor: pointer;display:" + (!rows.crucialUser ? "block" : "none") + "' title='删除'>删除</div>" +
            "</div>";
    }



    var rowIds;
    // jqgrid的具体执行方法
    jqgrid({
        gridTableId: "#gridTable",
        gridPagerId: "#gridPager",
        postData: {'projectId': $('#projectId').html().trim(),'projectType':2},
        autoScroll: false,
        shrinkToFit: false,
        multiselect: true,
        rownumbers: true,
        grouping:true,
        sortname:'taskName',
        groupingView : {
            groupField : ['taskName'],
            groupColumnShow : [false],
            groupText:['任务名：'+'<b>{0}</b>']
        },
        onSelectRow: function (rowid, status) {

        },
        loadComplete: function (data) {

        },
        onSelectAll: function (aRowids, status) {

        },
        gridComplete: function () {

        },
        ondblClickRow: function (rowid) {


        }
    });




    //重置表单
    function reset() {
        resetForm("#formDialog form");
    }





    //征地审批通过
    $("#kaigong-pass").click(function () {

        var data = {'projectType':2,"audit":1};
        var message='是否全部审核通过?';
        auditFeedback(data,message)

    });
    //征地审核不通过
    $("#kaigong-fail").click(function () {

        var data = {'projectType':2,"audit":2};
        var message='是否全部审核不通过?';
        auditFeedback(data,message)

    });





    function auditFeedback(data,message,){
        showDeleteDialog({
            data:data,
            url:"/sys/gongjian/auditFeedback/",
            tableId: "#gridTable",
            confirmTitle: "确认对话框",
            confirmMessage: message,
            confirmOk: "确定",
            confirmCancel: "取消",
            // successMessage: "删除成功",
            successTitle: "消息对话框",
            // failMessage: "删除失败",
            failTitle: "消息对话框",
            errorTitle: "警告提示框",
            errorMessage: "您当前尚未选中一行，请选择后再试",
            errorOk: "确定"
        });
    }


    // 页面跳转
    $(document).on("click", ".lookdetail", function (e) {

    });

    function showEditView(sysId) {

        loadDialog({
            dialogTitle: '反馈对话框',
            dialogUrl: "/sys/gongjian/edit/"+sysId,
            dialogFoot: '<button type="button" class="btn btn-primary" onclick="create()">添加</button>' +
                '<button type="button" class="btn btn-pink" onclick="reset()">重置</button>' +
                '<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>'
        });
    }

    function create() {
        executeSaveOrUpdate({
            formId: "#formDialog form",
            dialogId: "#formDialog",
            url: "/sys/gongjian/feedback",
            tableId: "#gridTable",
            successMessage: "反馈成功",
            successTitle: '反馈对话框',
            // failMessage: '保存失败',
            failTitle: '任务反馈结果:'
        });
    }


</script>


</body>
</html>